﻿<%@ Page Language="C#" 
AutoEventWireup="true" 
CodeBehind="Application.aspx.cs" 
Inherits="WebSite_that_use_Wizard.NET.Application" 
EnableSessionState="True" %>
<%@ Register src="Menu.ascx" tagname="Menu" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        
        <uc1:Menu ID="Menu1" runat="server" />
        <br />
        <h1>Application 
            </h1>
        <asp:DetailsView ID="DetailsView1" runat="server" 
            AutoGenerateRows="False" DataSourceID="ApplicationDataSource" Height="50px" 
            Width="125px" DefaultMode="Edit" CellPadding="4" ForeColor="#333333" 
            GridLines="None">
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <Fields>
                <asp:BoundField DataField="ApplicationId" HeaderText="ApplicationId" 
                    SortExpression="ApplicationId" ReadOnly="True" />
                <asp:BoundField DataField="ApplicationName" HeaderText="ApplicationName" 
                    SortExpression="ApplicationName" ReadOnly="True" />
            </Fields>
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:DetailsView>
        <asp:ObjectDataSource ID="ApplicationDataSource" runat="server" 
            SelectMethod="GetApplication" 
            TypeName="WebSite_that_use_Wizard.NET.Application+ApplicationPageHelper" 
            UpdateMethod="Update" 
            onobjectcreated="ObjectDataSource_ObjectCreated">
            <UpdateParameters>
                <asp:QueryStringParameter DefaultValue="" Name="queryApplicationId" 
                    QueryStringField="id" Type="Int32" />
                <asp:Parameter Name="applicationName" Type="String" />
            </UpdateParameters>
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="" Name="queryApplicationId" 
                    QueryStringField="id" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:LinkButton runat="server" id="lnkCreateNewSourceFile" 
            onclick="lnkCreateNewSourceFile_Click">Create New Source File</asp:LinkButton>
        &nbsp;<asp:LinkButton runat="server" id="lnkRunApplication" 
            onclick="Run_Click">Run</asp:LinkButton>
        &nbsp;<asp:LinkButton runat="server" id="lnkCompile" 
            onclick="Compile_Click">Compile</asp:LinkButton>
        &nbsp;<asp:Label ID="lblError" runat="server" Text="..."></asp:Label>
       <h2>SourceFiles</h2>
        <asp:GridView ID="GridView1" runat="server" DataSourceID="SourceFilesDataSource" 
            AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" 
            GridLines="None">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:BoundField DataField="FileName" HeaderText="FileName" 
                    SortExpression="FileName" ReadOnly="True" />
                <asp:BoundField DataField="SourceFileId" HeaderText="SourceFileId" 
                    SortExpression="SourceFileId" ReadOnly="True" />
                <asp:BoundField DataField="SourceText" HeaderText="SourceText" 
                    SortExpression="SourceText" ReadOnly="True" />
                <asp:CheckBoxField DataField="Compiled" HeaderText="Compiled" 
                    SortExpression="Compiled" ReadOnly="True" />
                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" 
                            CommandName="CustomCommand" CommandArgument='<%# Bind("SourceFileId") %>' onclick="ViewSourceFile_Click"  Text="View"></asp:LinkButton>
                            <!--
                             
                             
                            -->
                        <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" 
                            CommandName="CustomCommand" CommandArgument='<%# Bind("SourceFileId") %>' onclick="DeleteSourceFile_Click" Text="Delete"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        <asp:ObjectDataSource ID="SourceFilesDataSource" runat="server" 
            SelectMethod="GetSourceFiles" 
            TypeName="WebSite_that_use_Wizard.NET.Application+ApplicationPageHelper" 
            UpdateMethod="Update" 
            onobjectcreated="ObjectDataSource_ObjectCreated">
            <UpdateParameters>
                <asp:Parameter Name="queryApplicationId" Type="Int32" />
                <asp:Parameter Name="applicationName" Type="String" />
            </UpdateParameters>
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="" Name="queryApplicationId" 
                    QueryStringField="id" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <h2>ClassSources</h2>
        <asp:GridView ID="GridView2" runat="server" DataSourceID="ClassesDataSource" 
            AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" 
            GridLines="None">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:BoundField DataField="ClassSourceId" HeaderText="ClassSourceId" 
                    SortExpression="ClassSourceId" ReadOnly="True" />
                                        
                <asp:BoundField DataField="ClassName" HeaderText="ClassName" ReadOnly="True" 
                    SortExpression="ClassName" />
                                        
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
&nbsp;
        <asp:ObjectDataSource ID="ClassesDataSource" runat="server" 
            SelectMethod="GetClasses" 
            TypeName="WebSite_that_use_Wizard.NET.Application+ApplicationPageHelper" 
            UpdateMethod="UpdateClass"
            onobjectcreated="ObjectDataSource_ObjectCreated">
            <UpdateParameters>
                <asp:Parameter Name="queryApplicationId" Type="Int32" />
                <asp:Parameter Name="applicationName" Type="String" />
            </UpdateParameters>
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="" Name="queryApplicationId" 
                    QueryStringField="id" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </div>
    </form>
</body>
</html>
